package state.group.events;

import messages.ByteList;

public class FloorEvent extends ElevatorEvent {
    
    private byte floor;
    
    public FloorEvent(byte[] data, int startIndex)
    {
        super(data, startIndex);
        this.floor = data[startIndex + 2];
    }
    
    public FloorEvent(byte elevatorId, byte floor)
    {
        super(elevatorId);
        this.floor = floor;
    }
    
    public byte getFloor()
    {
        return floor;
    }

    @Override
    public int getEventByteLength()
    {
        return 3;
    }

    @Override
    public void appendToByteList(ByteList list)
    {
        super.appendToByteList(list);
        list.addByte(floor);
    }

    @Override
    public EventType getEventType()
    {
        return EventType.FloorEvent;
    }

}
